<?php

use yii\db\Migration;

/**
 * Class m190124_092713_alert_good_id_on_jobinfo
 */
class m190124_092713_alert_good_id_on_jobinfo extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->addColumn('job_info', 'good_id', $this->integer());
        $this->addForeignKey('fk_jobinfo_good_id_good', 'job_info', 'good_id', 'goods', 'id');
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m190124_092713_alert_good_id_on_jobinfo cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190124_092713_alert_good_id_on_jobinfo cannot be reverted.\n";

        return false;
    }
    */
}
